﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;
using System.Data;
using SmartEP.DTO;

namespace SmartEP.Model
{
    public class UserModel :BaseModel
    {
        public const string TABLE_NAME = "";
        public const string USER_NAME_FIELD = "UserName";
        public const string PASSWORD_FIELD = "Password";
        public const string FIRST_NAME_FIELD = "FirstName";
        public const string LAST_NAME_FIELD = "LastName";
        public const string MIDDLE_FIELD = "MiddleName";
        public const string BIRTHDAY_FIELD = "DOB";
        public const string PHONE_FIELD = "Phone";

        public UserModel() : base(TABLE_NAME) { }

        public DataSet AuthenticateUser(User user)
        {
            bool DemoMode = true;
            return this.GetStoreProcedureByName("AuthenticateUser", user.Username, user.Password, DemoMode);
        }

        public ArrayList ReadLoginXML(string FileName)
        {
            return ReadXML(FileName);
        }

        public void WriteLoginXML(string FileName, User User)
        {
            WriteLoginXML(FileName, User.Username,User.Password);
        }
    }
}